#!/bin/bash
cd kmesh
image_name=$1

make build
docker build --build-arg arch=amd64 -f build/docker/kmesh.dockerfile -t $image_name .

kind load docker-image $image_name --name ambient

kubectl -n kmesh-system get ds kmesh -o yaml > daemonset.yaml
yq '.spec.template.spec.containers[0].image = "'$image_name'"' -i daemonset.yaml
kubectl apply -f daemonset.yaml

kubectl get po -A -w | grep kmesh
